﻿@namespace MatBlazor
@inherits BaseMatPaginator


<div class="mat-paginator">
    <div class="mat-paginator-container">
        <div class="mat-paginator-page-size">
            <div class="mat-paginator-page-size-label">@Label</div>
            <MatSelectValue Class="mat-paginator-page-size-select" TValue="int" TItem="MatPageSizeOption" Items="@PageSizeOptions" Value="@PageSize" ValueChanged="@(_ => PageSizeChangedHandler(_))" ValueSelector="@(i => i.Value)"></MatSelectValue>
        </div>


        <div class="mat-paginator-range-actions">
            <span class="mat-paginator-range-labelmat-paginator-range-label">@PageLabel @(PageIndex + 1) / @TotalPages</span>
            <div class="mat-paginator-range-buttons">
                <MatIconButton Icon="first_page" OnClick=@(async () => NavigateToPage(MatPaginatorAction.First, PageSize)) Disabled=@(PageIndex <= 0)></MatIconButton>
                <MatIconButton Icon="navigate_before" OnClick=@(async () => NavigateToPage(MatPaginatorAction.Previous, PageSize)) Disabled=@(PageIndex <= 0)></MatIconButton>
              
                <MatIconButton Icon="navigate_next" OnClick="@(async () => NavigateToPage(MatPaginatorAction.Next, PageSize))" Disabled="@(TotalPages - PageIndex <= 1)"></MatIconButton>
                <MatIconButton Icon="last_page" OnClick=@(async () => NavigateToPage(MatPaginatorAction.Last, PageSize)) Disabled=@(TotalPages - PageIndex <= 1)></MatIconButton>
            </div>
        </div>

    </div>
</div>